package com.hmall.common.config;

import feign.Logger;
import feign.RequestInterceptor;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * Feign配置类
 */
@EnableFeignClients(basePackages = "com.hmall.common.client")
@Configuration
public class FeignConfig {

    //添加拦截器
    @Bean
    public RequestInterceptor requestInterceptor() {
        return requestTemplate -> requestTemplate.header("authorization", "2");
    }
    //设置日志级别
    @Bean
    public Logger.Level level() {
        return Logger.Level.BASIC;
    }
}
